package com.my.study.juc.basic.pattern.tuba;

/**
 * @author Carlos
 * @version 1.0
 * @Description 生产者
 * @date 2021/4/11 20:24
 **/
public class Productor extends Thread {

    private SynContainer container;

    public Productor(SynContainer container, String name) {
        super(name);
        this.container = container;
    }

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            container.push(new Chicken(i));
            System.out.println("生产了第 " + i + " 只鸡");
        }
    }
}
